package Stringtest4;

import java.util.Scanner;

public class Stringtest4puls {
    public static void main(String[] args) {
        ///创造一个登陆界面
        Scanner input = new Scanner(System.in);
        int i = 3;
        while (i > 0) {
            i--;
            System.out.println("请输入你的账户：");
            String user = input.next();
            System.out.println("请输入你的密码：");
            int passwd = input.nextInt();
            boolean rs = pass(user, passwd);
            if (rs) {
                System.out.println("密码很正确欢迎登陆系统");
                break;

            } else {
                System.out.println("密码错误你还有" + i + "次机会");
            }
        }

    }

    ///创造一个方法进行判断
    public static boolean pass(String realuser, int realpasswd) {
        return realuser.equals("ithema") && realpasswd == 123456;
        ///这个方法更高级一些
    }
}
